Skip to content

fix(deps): update dependency drizzle-orm to ^0.44.0 #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renovate[bot]
Copy link

@renovate renovate bot commented Jan 28, 2025

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
drizzle-orm (source) ^0.42.0 -> ^0.44.0 age adoption passing confidence

Release Notes

drizzle-team/drizzle-orm (drizzle-orm)

v0.44.1

Compare Source

v0.44.0

Compare Source

Error handling

Starting from this version, we’ve introduced a new DrizzleQueryError that wraps all errors from database drivers and provides a set of useful information:

  1. A proper stack trace to identify which exact Drizzle query failed
  2. The generated SQL string and its parameters
  3. The original stack trace from the driver that caused the DrizzleQueryError

Drizzle cache module

Drizzle sends every query straight to your database by default. There are no hidden actions, no automatic caching or invalidation - you’ll always see exactly what runs. If you want caching, you must opt in.

By default, Drizzle uses a explicit caching strategy (i.e. global: false), so nothing is ever cached unless you ask. This prevents surprises or hidden performance traps in your application. Alternatively, you can flip on all caching (global: true) so that every select will look in cache first.

Out first native integration was built together with Upstash team and let you natively use upstash as a cache for your drizzle queries

import { upstashCache } from "drizzle-orm/cache/upstash";
import { drizzle } from "drizzle-orm/...";

const db = drizzle(process.env.DB_URL!, {
  cache: upstashCache({
    // 👇 Redis credentials (optional — can also be pulled from env vars)
    url: '<UPSTASH_URL>',
    token: '<UPSTASH_TOKEN>',
    // 👇 Enable caching for all queries by default (optional)
    global: true,
    // 👇 Default cache behavior (optional)
    config: { ex: 60 }
  })
});

You can also implement your own cache, as Drizzle exposes all the necessary APIs, such as get, put, mutate, etc.
You can find full implementation details on the website

import Keyv from "keyv";
export class TestGlobalCache extends Cache {
  private globalTtl: number = 1000;
  // This object will be used to store which query keys were used
  // for a specific table, so we can later use it for invalidation.
  private usedTablesPerKey: Record<string, string[]> = {};
  constructor(private kv: Keyv = new Keyv()) {
    super();
  }
  // For the strategy, we have two options:
  // - 'explicit': The cache is used only when .$withCache() is added to a query.
  // - 'all': All queries are cached globally.
  // The default behavior is 'explicit'.
  override strategy(): "explicit" | "all" {
    return "all";
  }
  // This function accepts query and parameters that cached into key param,
  // allowing you to retrieve response values for this query from the cache.
  override async get(key: string): Promise<any[] | undefined> {
    ...
  }
  // This function accepts several options to define how cached data will be stored:
  // - 'key': A hashed query and parameters.
  // - 'response': An array of values returned by Drizzle from the database.
  // - 'tables': An array of tables involved in the select queries. This information is needed for cache invalidation.
  //
  // For example, if a query uses the "users" and "posts" tables, you can store this information. Later, when the app executes
  // any mutation statements on these tables, you can remove the corresponding key from the cache.
  // If you're okay with eventual consistency for your queries, you can skip this option.
  override async put(
    key: string,
    response: any,
    tables: string[],
    config?: CacheConfig,
  ): Promise<void> {
    ...
  }
  // This function is called when insert, update, or delete statements are executed.
  // You can either skip this step or invalidate queries that used the affected tables.
  //
  // The function receives an object with two keys:
  // - 'tags': Used for queries labeled with a specific tag, allowing you to invalidate by that tag.
  // - 'tables': The actual tables affected by the insert, update, or delete statements,
  //   helping you track which tables have changed since the last cache update.
  override async onMutate(params: {
    tags: string | string[];
    tables: string | string[] | Table<any> | Table<any>[];
  }): Promise<void> {
    ...
  }
}

For more usage example you can check our docs

v0.43.1

Compare Source

Fixes

v0.43.0

Compare Source

Features

  • Added cross join (#​1414)
  • Added lateral left, inner, cross joins to PostgreSQL, MySQL, Gel, SingleStore
  • Added drizzle connection attributes to SingleStore's driver instances

Fixes

  • Removed unsupported by dialect full join from MySQL select api
  • Forced Gel columns to always have explicit schema & table prefixes due to potential errors caused by lack of such prefix in subquery's selection when there's already a column bearing same name in context
  • Added missing export for PgTextBuilderInitial type
  • Removed outdated IfNotImported type check from SingleStore driver initializer
  • Fixed incorrect type inferrence for insert and update models with non-strict tsconfigs (#​2654)
  • Fixed invalid spelling of nowait flag (#​3554)
  • Add join lateral support
  • Remove .fullJoin() from MySQL API

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot force-pushed the renovate/drizzle-orm-0.x branch from 1b39e86 to 42aad3a Compare February 14, 2025 14:46
@renovate renovate bot changed the title fix(deps): update dependency drizzle-orm to ^0.39.0 fix(deps): update dependency drizzle-orm to ^0.40.0 Feb 26, 2025
@renovate renovate bot force-pushed the renovate/drizzle-orm-0.x branch from 42aad3a to c6b1287 Compare February 26, 2025 03:53
@renovate renovate bot force-pushed the renovate/drizzle-orm-0.x branch from c6b1287 to 2e481b9 Compare March 15, 2025 00:06
@renovate renovate bot changed the title fix(deps): update dependency drizzle-orm to ^0.40.0 fix(deps): update dependency drizzle-orm to ^0.41.0 Mar 22, 2025
@renovate renovate bot force-pushed the renovate/drizzle-orm-0.x branch 3 times, most recently from a74f262 to 1ad1db2 Compare March 26, 2025 22:03
@renovate renovate bot force-pushed the renovate/drizzle-orm-0.x branch from 1ad1db2 to cff35d3 Compare April 15, 2025 19:03
@renovate renovate bot changed the title fix(deps): update dependency drizzle-orm to ^0.41.0 fix(deps): update dependency drizzle-orm to ^0.42.0 Apr 15, 2025
@renovate renovate bot force-pushed the renovate/drizzle-orm-0.x branch 4 times, most recently from 952972d to b033e74 Compare April 22, 2025 19:04
@renovate renovate bot changed the title fix(deps): update dependency drizzle-orm to ^0.42.0 fix(deps): update dependency drizzle-orm to ^0.43.0 Apr 24, 2025
@renovate renovate bot force-pushed the renovate/drizzle-orm-0.x branch 2 times, most recently from 62c0697 to a1f2a89 Compare April 27, 2025 07:34
@renovate renovate bot force-pushed the renovate/drizzle-orm-0.x branch from a1f2a89 to 13a09d2 Compare May 2, 2025 17:13
@renovate renovate bot force-pushed the renovate/drizzle-orm-0.x branch 2 times, most recently from 4b9dc68 to dd95549 Compare May 14, 2025 20:25
@renovate renovate bot force-pushed the renovate/drizzle-orm-0.x branch 2 times, most recently from 24e020f to 7204a4b Compare May 24, 2025 11:38
@renovate renovate bot force-pushed the renovate/drizzle-orm-0.x branch from 7204a4b to a86776a Compare May 27, 2025 03:32
@renovate renovate bot force-pushed the renovate/drizzle-orm-0.x branch from a86776a to 6f4a3e1 Compare June 1, 2025 07:33
@renovate renovate bot changed the title fix(deps): update dependency drizzle-orm to ^0.43.0 fix(deps): update dependency drizzle-orm to ^0.44.0 Jun 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants